# Compatibility
CMAKE_MINIMUM_REQUIRED (VERSION 2.6)

# Project name
PROJECT (libspawner)

# Project version
SET (${PROJECT_NAME}_MAJOR_VERSION 0)
SET (${PROJECT_NAME}_MINOR_VERSION 1)
SET (${PROJECT_NAME}_PATCH_LEVEL 0)

INCLUDE_DIRECTORIES ("${PROJECT_SOURCE_DIR}/inc")
INCLUDE_DIRECTORIES ("${PROJECT_SOURCE_DIR}/inc/md5")
INCLUDE_DIRECTORIES ("${PROJECT_SOURCE_DIR}")

#OPTION(MYPROJECT_DEBUG "Build the project using debugging code" ON)

SET (CMAKE_BUILD_TYPE Release)

#IF(MYPROJECT_DEBUG)
#  SET_SOURCE_FILE_PROPERTIES(
#    libSource.c main.c
#    COMPILE_FLAGS -DDEBUG)
#ENDIF(MYPROJECT_DEBUG)

# fix relative path
FILE (GLOB SOURCES ./src/*.cpp ./src/md5/*.c)
FILE (GLOB HEADERS ./inc/*.h ./*.h)


FILE (GLOB LIB_WIN32_SOURCES "./src/win32/*.cpp")
FILE (GLOB LIB_NIX_SOURCES "./src/linux/*.cpp")


IF (UNIX)
	SET (SOURCES ${SOURCES} ${LIB_NIX_SOURCES})
ELSE (UNIX)
	IF (WIN32)
		SET (SOURCES ${SOURCES} ${LIB_WIN32_SOURCES})
	ENDIF (WIN32)
ENDIF (UNIX)


SET (PROJECT_LIBRARY ${PROJECT_NAME})


ADD_LIBRARY (${PROJECT_LIBRARY} ${SOURCES} ${HEADERS})
